package com.itwhy.mapper;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.itwhy.domain.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {

    /*void saveUser(User user);

    void deleteUser(Long id);

    void updateUser(User user);

    User queryUserById(Long id);*/

    List<User> queryUserByIds(List<Long> ids);

    void updateBalanceByIds(@Param("ew") LambdaUpdateWrapper<User> wrapper, int amount);

    @Update("update `user` set balance = balance - #{money} where id = #{id}")
    void updateBalanceById(Long id, Integer money);
    // 注意：ew注解必须加
}
